home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.compilers / comp.sys.amiga.programmer_20915_000001.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  2.2 KB

  1. Path: etek.chalmers.se!chalmers.se!sunic!mcsun!uunet!gatech!concert!sas!mozart.unx.sas.com!walker
  2. From: walker@twix.unx.sas.com (Doug Walker)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: SAS C 6.0 weirdness with __inline
  5. Message-ID: <BwDGJJ.452@unx.sas.com>
  6. Date: 19 Oct 92 14:06:54 GMT
  7. References: <0s6zr9@rpi.edu> <kruse.719496887@eola.cs.ucf.edu>
  8. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  9. Organization: SAS Institute Inc.
  10. Lines: 37
  11. Originator: walker@twix.unx.sas.com
  12. Nntp-Posting-Host: twix.unx.sas.com
  13.  
  14.  
  15. In article <kruse.719496887@eola.cs.ucf.edu>, kruse@cs.ucf.edu (Holger Kruse ) writes:
  16. |> Yes, I had the same problem. When you use the global Optimizer and call
  17. |> the __inline-function ONLY from the module where it has been defined,
  18. |> everything works fine. But if you compile without global optimizer or
  19. |> call the function from a different module, the linker will complain about
  20. |> an undefined symbol.
  21. |> At least this was my experience.
  22. |> 
  23. |> I reported that bug via EMITS about a week ago.
  24.  
  25. |> Holger Kruse
  26. |> kruse@eola.cs.ucf.edu
  27.  
  28. This is not a bug.  The inlining is performed by the global optimizer.
  29. Hence, if you don't run the global optimizer, you don't get inlining.
  30. You will need to declare a "real" version of the function to compile
  31. without the global optimizer in this case.
  32.  
  33. The global optimizer can't go around looking in all your .c files
  34. for inline function definitions; it can only see the .c file you
  35. are compiling and the .h files that it includes.  Hence, your
  36. __inline function definition has to be in one of those files or it
  37. won't be found.  The __inline substitution is done at compile-time,
  38. NOT at link time.  It's exactly like #define macros; the preprocessor
  39. only honors #define macros present in the .c file or a .h file
  40. included by the .c file.  It doesn't even know about #defines in
  41. some other .c file.
  42.  
  43. -- 
  44.   *****
  45. =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
  46.  *|. o.| ||                                          1200/2400/9600 Dual
  47.   | o  |//     For all you do, this bug's for you!
  48.   ====== 
  49. usenet: walker@unx.sas.com                            bix: djwalker 
  50. Any opinions expressed are mine, not those of SAS Institute, Inc.